package org.example.model.manage.security;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.example.model.manage.bean.po.security.MyUserDetails;

public class HeaderUserResolver {

    private final ObjectMapper objectMapper;

    public HeaderUserResolver(ObjectMapper objectMapper) {
        this.objectMapper = objectMapper;
    }

    public MyUserDetails parseUserDetails(String userInfoJson) throws Exception {
        return objectMapper.readValue(userInfoJson, MyUserDetails.class);
    }
}
